import Vue from 'vue'
import Vuex from 'vuex'
import mqtt from '../libs/mqtt'
import { setValue, getValue } from '../libs/util'
Vue.use(Vuex)

import chat from './module/chat'
import user from './module/user'

const store = new Vuex.Store({
    modules:{
        chat, user
    }
})

if(getValue('loginInfo').token){
    mqtt.initMqtt()
}

export default store;